'use strict';

/**
 * @param {Egg.Application} app - egg application
 */
module.exports = app => {
  const { router, controller } = app;
  // 登录
  router.post('/api/login', controller.home.loginController)
  // 注册
  router.post("/api/registry",controller.home.registryController)
  // 获取验证码
  router.get("/api/getCode",controller.home.getCode)

  router.resources('user', '/api/v1/user',controller.home)
  // 用户权限
  router.resources("role","/api/v1/userrole",controller.role)
  // 用户接口
  router.resources("interface","/api/v1/userInterface",controller.interface)
  // 视图
  router.resources("authView","/api/v1/authView",controller.authView)
  // 设置视图权限
  router.post("/api/setIdentity",controller.authViewsIdentity.setViewIdentity)
  // 获取视图权限
  router.get("/api/getIdentity",controller.authViewsIdentity.getViewIdentity)
};
